import org.jsoup.*;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

import java.sql.*;
import org.sqlite.*;


class mangaInfo{
	public static void main(String[] args) throws Exception {
		Document mangaInfo = Jsoup.connect("http://mangafox.me/manga/suki_to_ienai/").get();
		
		
		//récupérer les éléments importants de la page Web
		Element divTitle = mangaInfo.getElementById("title");
		Element divSeriesInfo = mangaInfo.getElementById("series_info");
		Element titleTab = divTitle.getElementsByTag("table").first().child(0).child(1);
		
		//Récupérer les informations liées au manga
		int mangaRelease = Integer.parseInt(titleTab.child(0).text());
		String mangaAuthor = titleTab.child(1).text();
		String mangaArtist = titleTab.child(2).text();
		String[] mangaGenres = titleTab.child(3).text().split(",");
		String mangaSum = divTitle.getElementsByClass("summary").html();
		String mangaStatus = divSeriesInfo.getElementsByClass("data").get(0).text().substring(8);
		String mangaRankingSentence = divSeriesInfo.getElementsByClass("data").get(1).text();
		String mangaRanking = mangaRankingSentence.substring(mangaRankingSentence.indexOf(":")+1,mangaRankingSentence.indexOf(",")).replaceAll("th","").trim();
		String mangaRatingSentence = divSeriesInfo.getElementsByClass("data").get(2).text();
		String mangaRating = mangaRatingSentence.substring(mangaRatingSentence.indexOf(":")+1,mangaRatingSentence.indexOf("/")).replaceAll("Average","").trim();
		
		System.out.println(mangaRelease);
		System.out.println(mangaAuthor);
		System.out.println(mangaArtist);
		System.out.println(mangaSum);
		System.out.println(mangaStatus);
		System.out.println(mangaRanking);
		System.out.println(mangaRating);
		

		
	} 
}